﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="HRMJobSpecList.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.HRMJobSpecList" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>
<%@ Register src="../Controls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc2" %> 

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">
    <title>โครงสร้างกรอบอัตรากำลัง</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel2">
                <UpdatedControls>                    
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>                    
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="panelCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="PanelDetail" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>

    <asp:panel ID="Panel6" runat="server" CssClass="contentPanelPaddingTop5px">
    <table width="1000" cellpadding="0" cellspacing="0">
        <tr>
            <td width="280" valign="top">
                <div class="Background980V3" style="width: 270px; min-height: 440px; margin-right:10px">
                    <table width="100%">
                        <tr class ="tableHeader">
                            <td class ="tableHeader" valign="middle">
                                ค้นหา : <telerik:RadTextBox ID="txtSearch" Runat="server" Width="140px" />
                                <asp:ImageButton ID="cmdSearch" runat="server" onclick="cmdSearch_Click" 
                                    ToolTip="กดปุ่มเพื่อเริ่มค้นหาข้อมูล" ImageUrl="~/App_UI/Images/Buttons/Magnifier.gif" />
                            </td>
                        </tr>
                    </table>
                    <asp:Panel ID="Panel2" runat="server" Width="100%" Height="100%" ScrollBars="Auto">
                        <telerik:RadTreeView ID="RadTreeView1" Runat="server" 
                                                DataFieldID="ID" 
                                                DataFieldParentID="Parent_id" 
                                                DataTextField="Name" 
                                                DataValueField="ID" 
                                                OnNodeExpand="RadTreeView1_NodeExpand" 
                                                onnodeclick="RadTreeView1_NodeClick"
                                                EnableDragAndDrop="False" 
                                                EnableDragAndDropBetweenNodes="true"
                                                CssClass="MinHeightSet"
                                                CausesValidation="False" />
                    </asp:Panel>
                </div>
            </td>
            <td valign = "top">
            <div class="Background980V3" style="width: 680px; margin-bottom: 5px; ">
             <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
                <table align = "center" width = "650px">
                    <tr>
                        <td align="right" >
                            ประเภทบุคลากร : </td>
                        <td align = "left">
                        <telerik:RadComboBox 
                            ID="cmbEmpType" 
                            DataTextField = "Name"
                            DataValueField = "Sequence"
                            AllowCustomText="true" 
                            runat="server" 
                            Width="200px"
                            Filter ="Contains"
                            AutoPostBack="True"
                            CausesValidation ="false"
                            ValidationGroup = "EmpType"
                            EmptyMessage="... เลือกประเภทบุคลากร ..."                 
                            onselectedindexchanged="cmbEmpType_SelectedIndexChanged">
                        </telerik:RadComboBox>
                        </td>
                      </tr>
                </table>
            </asp:Panel>
            </div>
            <div class="Background980V3" style="width:690px; min-height: 413px; padding: 0px 5px 0px 5px;"> 
                <asp:Panel ID="Panel1" runat="server"  Width="100%" >
                <asp:Panel ID="panelCommand" runat="server" >
                    <table width="100%">
                        <tr>
                            <td  align="left" valign="top" bgcolor="#7DA5E0" width="100%" colspan="2" 
                                style="padding: 5px; color: #FFFFFF; font-weight: bold; font-family: 'Segoe UI'; font-size: 13px;">
                                 ข้อมูลคุณสมบัติประจำตำแหน่ง/ ตำแหน่ง : <asp:Label runat="server" ID="lblNamePos"></asp:Label>
                            </td>
                        </tr>
                    </table> 
                    <div class="DivInfo" id="blockCommand" runat="server" >
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <asp:LinkButton Font-Underline="False" Font-Weight="Bold" ID="ShowGrid" runat="server" OnClick="ShowGrid_Click">
                                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/Refresh.gif" />&nbsp;&nbsp;แสดงข้อมูลทั้งหมด
                                </asp:LinkButton>  
                                <asp:LinkButton Font-Underline="False" Font-Weight="Bold" ID="AddNew" 
                                                runat="server" onclick="AddNew_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                </asp:LinkButton>
                                <asp:LinkButton Font-Underline="False" Font-Weight="Bold" ID="Save_AddNew" 
                                                runat="server" onclick="Save_AddNew_Click" OnClientClick="javascript:return confirm('ต้องการบันทึกข้อมูลใช่หรือไม่')">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/saveDisk.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                </asp:LinkButton>  
                                <asp:LinkButton Font-Underline="False" Font-Weight="Bold" ID="Save_Edit" 
                                                runat="server" onclick="Save_Edit_Click" OnClientClick="javascript:return confirm('ต้องการบันทึกข้อมูลใช่หรือไม่')">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/saveDisk.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="Delete" runat="server" CssClass="ControlLinkButton" OnClick="Delete_Click"
                                                OnClientClick="javascript:return confirm('ต้องการลบข้อมูลใช่หรือไม่')">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/Delete.gif" CommandName="GridDelete" />&nbsp;&nbsp;ลบข้อมูล
                                </asp:LinkButton>
                              </td>
                            </tr>
                      </table> 
                   </div>     
                  </asp:Panel>   
                    <asp:Panel ID="PanelGrid" runat="server" Height="330px" ScrollBars="Auto" 
                        Width="690px" Visible = "false"> 
                        <telerik:RadGrid ID="dgtJobSpecCtrl" runat="server" AllowAutomaticDeletes="True" 
                            AllowFilteringByColumn="True" AllowMultiRowEdit="True" 
                            AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                            AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" 
                            GridLines="None" 
                            GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                            GroupingSettings-GroupContinuedFormatString="" 
                            GroupingSettings-GroupContinuesFormatString="" 
                            GroupingSettings-GroupSplitFormat="" OnItemCommand="dgtJobSpecCtrl_ItemCommand" 
                            OnNeedDataSource="dgtJobSpecCtrl_NeedDataSource" Skin="Office2007" 
                            Width="670px">
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                                ClientDataKeyNames="pos_seq" CommandItemDisplay="Top" DataKeyNames="pos_seq" 
                                EditMode="PopUp" InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                <CommandItemTemplate>
                                </CommandItemTemplate>
                                <Columns>
                                    <telerik:GridBoundColumn HeaderText="PK"  UniqueName="job_spec_seq" DataField="job_spec_seq" Visible="false"></telerik:GridBoundColumn>
                                    <telerik:GridClientSelectColumn UniqueName="checkCol">
                                        <HeaderStyle Width="20px"/>
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridButtonColumn HeaderText="แก้ไข" ImageUrl="../Images/Buttons/Edit.gif" ButtonType="ImageButton" CommandName="GridEdit">
                                        <HeaderStyle Width="20px" />
                                    </telerik:GridButtonColumn>
                                    <telerik:GridBoundColumn HeaderText="คุณสมบัติประจำตำแหน่ง" DataField="spec_detail" UniqueName="spec_detail"
                                        ShowFilterIcon="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%">
                                        <HeaderStyle Width="150%" />
                                    </telerik:GridBoundColumn>
                                </Columns>
                             <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView>
                            <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                            </ClientSettings>
                        </telerik:RadGrid>  
                    </asp:Panel>
                <asp:Panel ID="PanelDetail" runat="server" Width = "690px" ScrollBars ="Auto">
                    <table width = "650" align ="center" >
                        <tr>
                            <td>คุณสมบัติประจำตำแหน่ง :</td>
                            <td>
                                <asp:Label runat="server" ID="lblJobSpecSeq" Visible="False"></asp:Label>
                                <asp:Label runat="server" ID="lblPosSeq" Visible="False"></asp:Label> 
                                <asp:Label ID="lblPosRef" runat="server" Visible="False"></asp:Label>  
                                <asp:TextBox ID="txtSpecDetail" runat="server" TextMode="MultiLine" Width="450px" Height="90px">
                                </asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
               </asp:Panel> 
            </div>
        </td>
        </tr> 
    </table> 
   </asp:panel>
</asp:Content>